<#assign module="gasstation"/>

<@override name="header">
</@override>
<@override name="body">

<div class="row">
	<div class="col-xs-12">
		<ul class="nav nav-tabs">
            <li class="active"><a href="${ctx}/gasstation/edit/${gsid}">基本信息</a></li>
            <li><a href="${ctx}/gasstation/editGasPrice/${gsid}">油价设置</a></li>
            <li><a href="${ctx}/gasstation/paymentsRecord/${gsid}">资金流水</a></li>
            <li><a href="${ctx}/gasstation/review/${gsid}">油站评价</a></li>
        </ul>
	</div>
</div>
<div class="row col-xs-8">
	<div class="form-horizontal">
	  	<form id="submit_form" action=""  method="post">
	  		<input type="hidden" id="id" name="id" value="${gasStation.id}"/>
	  		<input type="hidden" id="lat" name="lat" value="${gasStation.lat}"/>
	  		<input type="hidden" id="lng" name="lng" value="${gasStation.lng}"/>
			<input type="hidden" id="companyName" name="companyName" value="${gasStation.companyName?if_exists}">
      		<input type="hidden" id="serviceNo" name="serviceNo" value="${gasStation.serviceNo?if_exists}">
      		
			 <div class="form-group">
	         	<label class="col-sm-3 control-label">服务号:</label>
	         	<div class="col-sm-3" style="margin-top:8px;">
	         	  <label>${gasStation.serviceNo?if_exists}</label>
	         	</div>
	         </div>
	         
	         <div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>加油站名称:</label>
	            <div class="col-sm-3">
	            	<input id="name"  name="name" value="${gasStation.name?if_exists}" class="form-control"></input>
	            </div>
			 </div>
			  <div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>特权油站:</label>
	            <div class="col-sm-3">
	            	<input type="radio" <#if gasStation.privilege>checked="checked"</#if> name="privilege" value="1" />是
	            	<input type="radio" <#if !gasStation.privilege>checked="checked"</#if> name="privilege" value="0" />否
	            </div>
			 </div>
	         <div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>是否专享:</label>
	            <div class="col-sm-3">
	            	<input type="radio" <#if gasStation.vip>checked="checked"</#if> name="vip" value="1" />是
	            	<input type="radio" <#if !gasStation.vip>checked="checked"</#if> name="vip" value="0" />否
	            </div>
			 </div>
			 
			 <div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>代理品牌:</label>
	            <div class="col-sm-3">
	            	<input id="brand" name="brand" value="${gasStation.brand?if_exists}" class="form-control" maxLength="10"></input>
	            </div>
			</div>
			<@shiro.isMainCompany>
      		<div class="form-group">
                <label class="col-sm-3 control-label"><em>*</em>所属分公司：</label>
                <div class="col-sm-3">
	                <select class="form-control" id="companyId" name="companyId">
						<#if companys??>
							<#list companys as company>
								<option  value="${company.id}" <#if gasStation.companyId?? && gasStation.companyId==company.id>selected="selected"</#if>>${company.abbreviation?if_exists}</option>
							</#list>
						</#if>
					</select>
                </div>
			</div>
			</@shiro.isMainCompany>
			<div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>联系人:</label>
	            <div class="col-sm-3">
	            	<input id="contacts" name="contacts" value="${gasStation.contacts?if_exists}" class="form-control"></input>
	            </div>
			</div>
			<div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>联系人电话:</label>
	            <div class="col-sm-3">
	            	<input id="contactsPhone" name="contactsPhone" value="${gasStation.contactsPhone?if_exists}" class="form-control"></input>
	            </div>
			</div>
			<div class="form-group">
	            <label class="col-sm-3 control-label">座机:</label>
	            <div class="col-sm-3">
	            	<input id="telephone" name="telephone" value="${gasStation.telephone?if_exists}" class="form-control"></input>
	            </div>
			</div>
			<div class="form-group">
		        <label class="col-sm-3 control-label"><em>*</em>地区选择:</label>
		        <div class="col-sm-2">
			        <select id="provincial" class="form-control"  name="provincial"></select>
			    </div>
		        <div class="col-sm-2">
			        <select id="city" class="form-control" name="city"></select>
			    </div>
		        <div class="col-sm-2">
			        <select id="county" class="form-control" name="county"></select>
			    </div>
		    </div>
		    
		    <div class="form-group">
	            <label class="col-sm-3 control-label"><em>*</em>详细地址:</label>
	            <div class="col-sm-4">
	            	<input id="address" name="address" value="${gasStation.address?if_exists}" class="form-control"></input>
	            </div>
	            <div class="col-sm-1">
	            	<span class="btn btn-primary" id="btn_address">定位</span>
	            </div>
	            <div class="col-sm-3">
	            	<label class="control-label">经度：</label><label id="lng_label" >${gasStation.lng}</label>&emsp;&emsp;
	            	<label class="control-label">纬度：</label><label id="lat_label" >${gasStation.lat}</label>
	            </div>
			</div>
			
			<div class="form-group">
				<div class="col-sm-3">
	            </div>
				<div class="col-sm-6 panel-default" style="width:900px;">
					<div class="panel-heading">
						加油站位置定位
				    </div>
				    <div id="allmap" style="z-index: 99999; height:600px;">
	        		</div>
				</div>
			</div>
		    <div class="form-group">
	     	   <div class="col-sm-6">
	    	   </div>
	    	   <div class="col-sm-3" style="margin-top:15px;">
			      <input  type="button" class="btn btn-primary" id="update" value="保存">
	    	   </div>
	        </div>  
	  	</form>
	</div>
</div>


</@override>
<@override name="footer">
<script src="${ctx}/assets/js/region_select.js"></script>
<script type="text/javascript">
	window.daijia = {ctx : '${ctx}',lng:'${gasStation.lng}',lat:'${gasStation.lat}',address:'${gasStation.address}',
	provincial:'${gasStation.provincial}',city:'${gasStation.city}',county:'${gasStation.county}'};
</script>
<script src="//api.map.baidu.com/api?v=2.0&ak=AuNk3YS21DSmHEEvIFDf9dbD" type="text/javascript"></script>
<script src="${ctx}/assets/js/gasstation/edit.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		
	});
</script>
</@override>
<@extends name="../layout.ftl"/>
